import { _decorator, Component, Node, Sprite } from 'cc';
import { GAME_SPRITEFRAME } from '../Data/GlobalData';
const { ccclass, property } = _decorator;

@ccclass('PopSingleCollect')
export class PopSingleCollect extends Component {

    //收藏品
    @property(Sprite)
    private Collect: Sprite = null;

    //阴影
    @property(Node)
    public Shadow: Node = null;

    //对号
    @property(Node)
    private Right: Node = null;

    /**
     * 初始化
     */
    public Init(_index: number) {
        this.Collect.spriteFrame = app.resManager.SpriteFrames[GAME_SPRITEFRAME.Collect + _index];
    }

    /**
     * 我是否拥有
     */
    public IsHave(_isHave: boolean) {
        this.Right.active = _isHave;
        this.Shadow.active = !_isHave;
    }


}


